<?php
namespace app\index\controller;
use think\Db;

class Guest extends Base{
    public function index(){
        $arters = Db::name('article')
                    -> alias('a')
                    -> join('cate c', 'c.id = a.cate_id', 'LEFT')
                    -> field('a.*, c.catename')
                    -> order('a.id DESC')
                    -> select();

        $this -> assign('arters', $arters);
        return $this -> fetch('guest');
    }
}